# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BigQuery.V2.Model.Dataset do
  @moduledoc """
  Represents a BigQuery dataset.

  ## Attributes

  *   `access` (*type:* `list(GoogleApi.BigQuery.V2.Model.DatasetAccess.t)`, *default:* `nil`) - Optional. An array of objects that define dataset access for one or more entities. You can set this property when inserting or updating a dataset in order to control who is allowed to access the data. If unspecified at dataset creation time, BigQuery adds default dataset access for the following entities: access.specialGroup: projectReaders; access.role: READER; access.specialGroup: projectWriters; access.role: WRITER; access.specialGroup: projectOwners; access.role: OWNER; access.userByEmail: [dataset creator email]; access.role: OWNER; If you patch a dataset, then this field is overwritten by the patched dataset's access field. To add entities, you must supply the entire existing access array in addition to any new entities that you want to add.
  *   `creationTime` (*type:* `String.t`, *default:* `nil`) - Output only. The time when this dataset was created, in milliseconds since the epoch.
  *   `datasetReference` (*type:* `GoogleApi.BigQuery.V2.Model.DatasetReference.t`, *default:* `nil`) - Required. A reference that identifies the dataset.
  *   `defaultCollation` (*type:* `String.t`, *default:* `nil`) - Optional. Defines the default collation specification of future tables created in the dataset. If a table is created in this dataset without table-level default collation, then the table inherits the dataset default collation, which is applied to the string fields that do not have explicit collation specified. A change to this field affects only tables created afterwards, and does not alter the existing tables. The following values are supported: * 'und:ci': undetermined locale, case insensitive. * '': empty string. Default to case-sensitive behavior.
  *   `defaultEncryptionConfiguration` (*type:* `GoogleApi.BigQuery.V2.Model.EncryptionConfiguration.t`, *default:* `nil`) - The default encryption key for all tables in the dataset. After this property is set, the encryption key of all newly-created tables in the dataset is set to this value unless the table creation request or query explicitly overrides the key.
  *   `defaultPartitionExpirationMs` (*type:* `String.t`, *default:* `nil`) - This default partition expiration, expressed in milliseconds. When new time-partitioned tables are created in a dataset where this property is set, the table will inherit this value, propagated as the `TimePartitioning.expirationMs` property on the new table. If you set `TimePartitioning.expirationMs` explicitly when creating a table, the `defaultPartitionExpirationMs` of the containing dataset is ignored. When creating a partitioned table, if `defaultPartitionExpirationMs` is set, the `defaultTableExpirationMs` value is ignored and the table will not be inherit a table expiration deadline.
  *   `defaultRoundingMode` (*type:* `String.t`, *default:* `nil`) - Optional. Defines the default rounding mode specification of new tables created within this dataset. During table creation, if this field is specified, the table within this dataset will inherit the default rounding mode of the dataset. Setting the default rounding mode on a table overrides this option. Existing tables in the dataset are unaffected. If columns are defined during that table creation, they will immediately inherit the table's default rounding mode, unless otherwise specified.
  *   `defaultTableExpirationMs` (*type:* `String.t`, *default:* `nil`) - Optional. The default lifetime of all tables in the dataset, in milliseconds. The minimum lifetime value is 3600000 milliseconds (one hour). To clear an existing default expiration with a PATCH request, set to 0. Once this property is set, all newly-created tables in the dataset will have an expirationTime property set to the creation time plus the value in this property, and changing the value will only affect new tables, not existing ones. When the expirationTime for a given table is reached, that table will be deleted automatically. If a table's expirationTime is modified or removed before the table expires, or if you provide an explicit expirationTime when creating a table, that value takes precedence over the default expiration time indicated by this property.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. A user-friendly description of the dataset.
  *   `etag` (*type:* `String.t`, *default:* `nil`) - Output only. A hash of the resource.
  *   `externalCatalogDatasetOptions` (*type:* `GoogleApi.BigQuery.V2.Model.ExternalCatalogDatasetOptions.t`, *default:* `nil`) - Optional. Options defining open source compatible datasets living in the BigQuery catalog. Contains metadata of open source database, schema or namespace represented by the current dataset.
  *   `externalDatasetReference` (*type:* `GoogleApi.BigQuery.V2.Model.ExternalDatasetReference.t`, *default:* `nil`) - Optional. Reference to a read-only external dataset defined in data catalogs outside of BigQuery. Filled out when the dataset type is EXTERNAL.
  *   `friendlyName` (*type:* `String.t`, *default:* `nil`) - Optional. A descriptive name for the dataset.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Output only. The fully-qualified unique name of the dataset in the format projectId:datasetId. The dataset name without the project name is given in the datasetId field. When creating a new dataset, leave this field blank, and instead specify the datasetId field.
  *   `isCaseInsensitive` (*type:* `boolean()`, *default:* `nil`) - Optional. TRUE if the dataset and its table names are case-insensitive, otherwise FALSE. By default, this is FALSE, which means the dataset and its table names are case-sensitive. This field does not affect routine references.
  *   `kind` (*type:* `String.t`, *default:* `bigquery#dataset`) - Output only. The resource type.
  *   `labels` (*type:* `map()`, *default:* `nil`) - The labels associated with this dataset. You can use these to organize and group your datasets. You can set this property when inserting or updating a dataset. See [Creating and Updating Dataset Labels](https://cloud.google.com/bigquery/docs/creating-managing-labels#creating_and_updating_dataset_labels) for more information.
  *   `lastModifiedTime` (*type:* `String.t`, *default:* `nil`) - Output only. The date when this dataset was last modified, in milliseconds since the epoch.
  *   `linkedDatasetMetadata` (*type:* `GoogleApi.BigQuery.V2.Model.LinkedDatasetMetadata.t`, *default:* `nil`) - Output only. Metadata about the LinkedDataset. Filled out when the dataset type is LINKED.
  *   `linkedDatasetSource` (*type:* `GoogleApi.BigQuery.V2.Model.LinkedDatasetSource.t`, *default:* `nil`) - Optional. The source dataset reference when the dataset is of type LINKED. For all other dataset types it is not set. This field cannot be updated once it is set. Any attempt to update this field using Update and Patch API Operations will be ignored.
  *   `location` (*type:* `String.t`, *default:* `nil`) - The geographic location where the dataset should reside. See https://cloud.google.com/bigquery/docs/locations for supported locations.
  *   `maxTimeTravelHours` (*type:* `String.t`, *default:* `nil`) - Optional. Defines the time travel window in hours. The value can be from 48 to 168 hours (2 to 7 days). The default value is 168 hours if this is not set.
  *   `resourceTags` (*type:* `map()`, *default:* `nil`) - Optional. The [tags](https://cloud.google.com/bigquery/docs/tags) attached to this dataset. Tag keys are globally unique. Tag key is expected to be in the namespaced format, for example "123456789012/environment" where 123456789012 is the ID of the parent organization or project resource for this tag key. Tag value is expected to be the short name, for example "Production". See [Tag definitions](https://cloud.google.com/iam/docs/tags-access-control#definitions) for more details.
  *   `restrictions` (*type:* `GoogleApi.BigQuery.V2.Model.RestrictionConfig.t`, *default:* `nil`) - Optional. Output only. Restriction config for all tables and dataset. If set, restrict certain accesses on the dataset and all its tables based on the config. See [Data egress](https://cloud.google.com/bigquery/docs/analytics-hub-introduction#data_egress) for more details.
  *   `satisfiesPzi` (*type:* `boolean()`, *default:* `nil`) - Output only. Reserved for future use.
  *   `satisfiesPzs` (*type:* `boolean()`, *default:* `nil`) - Output only. Reserved for future use.
  *   `selfLink` (*type:* `String.t`, *default:* `nil`) - Output only. A URL that can be used to access the resource again. You can use this URL in Get or Update requests to the resource.
  *   `storageBillingModel` (*type:* `String.t`, *default:* `nil`) - Optional. Updates storage_billing_model for the dataset.
  *   `tags` (*type:* `list(GoogleApi.BigQuery.V2.Model.DatasetTags.t)`, *default:* `nil`) - Output only. Tags for the dataset. To provide tags as inputs, use the `resourceTags` field.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Output only. Same as `type` in `ListFormatDataset`. The type of the dataset, one of: * DEFAULT - only accessible by owner and authorized accounts, * PUBLIC - accessible by everyone, * LINKED - linked dataset, * EXTERNAL - dataset with definition in external metadata catalog.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :access => list(GoogleApi.BigQuery.V2.Model.DatasetAccess.t()) | nil,
          :creationTime => String.t() | nil,
          :datasetReference => GoogleApi.BigQuery.V2.Model.DatasetReference.t() | nil,
          :defaultCollation => String.t() | nil,
          :defaultEncryptionConfiguration =>
            GoogleApi.BigQuery.V2.Model.EncryptionConfiguration.t() | nil,
          :defaultPartitionExpirationMs => String.t() | nil,
          :defaultRoundingMode => String.t() | nil,
          :defaultTableExpirationMs => String.t() | nil,
          :description => String.t() | nil,
          :etag => String.t() | nil,
          :externalCatalogDatasetOptions =>
            GoogleApi.BigQuery.V2.Model.ExternalCatalogDatasetOptions.t() | nil,
          :externalDatasetReference =>
            GoogleApi.BigQuery.V2.Model.ExternalDatasetReference.t() | nil,
          :friendlyName => String.t() | nil,
          :id => String.t() | nil,
          :isCaseInsensitive => boolean() | nil,
          :kind => String.t() | nil,
          :labels => map() | nil,
          :lastModifiedTime => String.t() | nil,
          :linkedDatasetMetadata => GoogleApi.BigQuery.V2.Model.LinkedDatasetMetadata.t() | nil,
          :linkedDatasetSource => GoogleApi.BigQuery.V2.Model.LinkedDatasetSource.t() | nil,
          :location => String.t() | nil,
          :maxTimeTravelHours => String.t() | nil,
          :resourceTags => map() | nil,
          :restrictions => GoogleApi.BigQuery.V2.Model.RestrictionConfig.t() | nil,
          :satisfiesPzi => boolean() | nil,
          :satisfiesPzs => boolean() | nil,
          :selfLink => String.t() | nil,
          :storageBillingModel => String.t() | nil,
          :tags => list(GoogleApi.BigQuery.V2.Model.DatasetTags.t()) | nil,
          :type => String.t() | nil
        }

  field(:access, as: GoogleApi.BigQuery.V2.Model.DatasetAccess, type: :list)
  field(:creationTime)
  field(:datasetReference, as: GoogleApi.BigQuery.V2.Model.DatasetReference)
  field(:defaultCollation)
  field(:defaultEncryptionConfiguration, as: GoogleApi.BigQuery.V2.Model.EncryptionConfiguration)
  field(:defaultPartitionExpirationMs)
  field(:defaultRoundingMode)
  field(:defaultTableExpirationMs)
  field(:description)
  field(:etag)

  field(:externalCatalogDatasetOptions,
    as: GoogleApi.BigQuery.V2.Model.ExternalCatalogDatasetOptions
  )

  field(:externalDatasetReference, as: GoogleApi.BigQuery.V2.Model.ExternalDatasetReference)
  field(:friendlyName)
  field(:id)
  field(:isCaseInsensitive)
  field(:kind)
  field(:labels, type: :map)
  field(:lastModifiedTime)
  field(:linkedDatasetMetadata, as: GoogleApi.BigQuery.V2.Model.LinkedDatasetMetadata)
  field(:linkedDatasetSource, as: GoogleApi.BigQuery.V2.Model.LinkedDatasetSource)
  field(:location)
  field(:maxTimeTravelHours)
  field(:resourceTags, type: :map)
  field(:restrictions, as: GoogleApi.BigQuery.V2.Model.RestrictionConfig)
  field(:satisfiesPzi)
  field(:satisfiesPzs)
  field(:selfLink)
  field(:storageBillingModel)
  field(:tags, as: GoogleApi.BigQuery.V2.Model.DatasetTags, type: :list)
  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.BigQuery.V2.Model.Dataset do
  def decode(value, options) do
    GoogleApi.BigQuery.V2.Model.Dataset.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BigQuery.V2.Model.Dataset do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
